package commands;

import clientRequest.ClientRequest;
import controller.ExecutorsManager;
import controller.ExecutorsManager.ModifyFileExecutor;

/**
 * class ModifyFileCommand - execute modify file command
 */
public class ModifyFileCommand {
	ModifyFileExecutor modifyFileExecutor = ExecutorsManager.getInstance().getModifyFileExecutor();
	
	/**
	 * constructor
	 */
	public ModifyFileCommand(){}

	/**
	 * update the user file
	 * @param clientRequest - a client request that contains the file details
	 * @return 1 - if succeed. 0 - if failed.
	 */
	public int action(ClientRequest clientRequest)
	{
		// TODO Auto-generated method stub
		return modifyFileExecutor.addRequest(clientRequest.getUserID(), clientRequest.getFileName(),clientRequest.getFilePath(), clientRequest.getByteFile(), clientRequest.getChecksum(), clientRequest.isMyDropBox());				
	}

}
